/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.ds.vetxsoft.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author cuero
 */
@Embeddable
public class ConsultaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CODIGO")
    private String codigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "COD_HISTORIA_CLINICA")
    private String codHistoriaClinica;

    public ConsultaPK() {
    }

    public ConsultaPK(String codigo, String codHistoriaClinica) {
        this.codigo = codigo;
        this.codHistoriaClinica = codHistoriaClinica;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getCodHistoriaClinica() {
        return codHistoriaClinica;
    }

    public void setCodHistoriaClinica(String codHistoriaClinica) {
        this.codHistoriaClinica = codHistoriaClinica;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigo != null ? codigo.hashCode() : 0);
        hash += (codHistoriaClinica != null ? codHistoriaClinica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConsultaPK)) {
            return false;
        }
        ConsultaPK other = (ConsultaPK) object;
        if ((this.codigo == null && other.codigo != null) || (this.codigo != null && !this.codigo.equals(other.codigo))) {
            return false;
        }
        if ((this.codHistoriaClinica == null && other.codHistoriaClinica != null) || (this.codHistoriaClinica != null && !this.codHistoriaClinica.equals(other.codHistoriaClinica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.ds.vetxsoft.entity.ConsultaPK[ codigo=" + codigo + ", codHistoriaClinica=" + codHistoriaClinica + " ]";
    }
    
}
